a, b = map(int, input().split())
s = 0
cnt = 0
for i in range(a, b + 1):
    cnt += 1
    s += i
    print("%5d" % i, end='')
    if cnt == 5:
        print("\n", end='')
        cnt = 0
    elif i == b:
        print("\n", end='')
print("Sum = %d" % s)
